<head th:fragment="culHeaderCss">
    <meta charset="utf-8">
    <title>西宁城市职业技术学院</title>
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <meta name="keywords" content="西宁城市"/>
    <meta name="description"
          content="西宁城市职业技术学院"/>
    <meta name="renderer" content="webkit">
    <link rel="stylesheet" href="/css/bootstrap.min.css" type="text/css"/>
<!--    <link rel="stylesheet" href="/js/layui/css/layui.css">-->
    <link rel="stylesheet" href="/lib/layui/css/layui.css">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
    <link rel="stylesheet" href="/css/cultivateWeb/style/reset.css">
    <!--    <link rel="stylesheet" href="//at.alicdn.com/t/font_1631099_c2ht6ck3pi.css">-->
    <link rel="stylesheet" href="/css/cultivateWeb/headfoot.css"/>
    <link rel="stylesheet" href="/css/cultivateWeb/index.css">
    <link rel="stylesheet" href="/css/cultivateWeb/font_1166024_vobajbx8d1o.css"/>
    <link rel="stylesheet" href="/css/cultivateWeb/font_1631099_apll1sleb7k.css"/>
    <link rel="stylesheet" href="/css/cultivateWeb/dyf.css">
    <link rel="stylesheet" href="/css/cultivateWeb/style/main.css"/>
    <link href="/lib/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <link rel="stylesheet" href="/css/selectpage.css" type="text/css">
</head>
<!--头部部分-->
<div class="heads" th:fragment="header(mymenu)" style="background: #fff">
    <script src="/js/jquery.min.js"></script>

<!--    <script src="/js/layui/layui.js"></script>-->
    <script src="/lib/layui/layui.js"></script>

    <script type="text/javascript" src="/js/cultivateWeb/main.js"></script>
    <!--分页下拉框-->
    <script type="text/javascript" src="/js/selectpage.js"></script>
    <script type="text/javascript" src="/js/mobile.js"></script>
    <style>
        .myheader {
            width: 100%;
            height: 220px;
            background-color: #0069ac;
        }

        .myheader-top {
            width: 100%;
            display: flex;
            flex-direction: row;
            justify-content: flex-start;
            /*height: calc(100% - 70px);*/
            /*background: url("/img/header.png");*/
            /*background-size: 108% 100%;*/
            /*background-color: #ffffff;*/
            background: linear-gradient(#c7ddf4, #fcfdff);
        }

        .myheader-top-dengs {

        }

        .myheader-top-dengs a {
            width: 30px;
            font-size: 15px;
            padding: 0 5px;
            color: #FFFFFF;
        }

        .myheader-list {
            display: flex;
            height: 47px;
            align-items: center;
            justify-content: space-between;

        }

        .myheader-list ul {
            display: flex;
            flex-direction: row;

        }

        .myheader-list ul li {
            line-height: 45px;
            font-size: 18px;
            margin: 0 10px;
        }

        .myheader-list ul li a {
            color: #FFFFFF;
        }

        /*.myheader-list ul li.active a, .myheader-list ul li a:hover {*/
        /*    color: #000000;*/
        /*}*/

        .myheader-list ul li i.active, .myheader-list ul li i:hover {
            display: flex;
        }

    </style>
    <th:block th:if="${mymenu}">
        <div class="myheader" style="height:180px;">
            <div class="myheader-top" style="height:calc(100% - 47px);">
            <div class=" main-md" style="  height: 100%;display: flex;   justify-content: space-between;">
                <a href="/cultivate/homepage" style="display: flex;" class="myImg">
                </a>

                <div style="   display: flex;
                     justify-content: flex-end;     align-items: center;">
                    <div class="layui-input-group">
                        <input type="text" id="myAllsearchInput" placeholder="请输入关键字" class="layui-input"
                               style=" width: 200px;">
                        <div id="myAllsearch" class="layui-input-split layui-input-suffix"
                             style="cursor: pointer;background: #fff;">
                            <i class="layui-icon layui-icon-search"></i>
                        </div>
                    </div>

                </div>
            </div>

            </div>
            <div class="myheader-list main-md" style="min-width: 1000px;  ">
                    <ul id="menuUl" style="width: 800px;height: 100%; align-items: center; margin: 0;">
                        <li class="item" style="flex: 1;height: 100%; display: flex;  flex-direction: column;">
                            <a href="/cultivate/homepage" style="text-align: center;position: relative;font-size: 15px;">网站首页</a>
                            <i class="layui-icon layui-icon-triangle-d" style="
                        display: none;   justify-content: center; align-items: center;top: -24px; position: relative;
                    color:#ffffff; transform: rotateX(180deg);"> </i>
                        </li>
                        <li class="item" style="flex: 1;height: 100%; display: flex;  flex-direction: column;">
                            <a href="/cultivate/courseIndex?pageSign=1" style="text-align: center;position: relative;font-size: 15px;">精品课程</a>
                            <i class="layui-icon layui-icon-triangle-d" style="
                        display: none;   justify-content: center; align-items: center;top: -24px; position: relative;
                    color:#ffffff; transform: rotateX(180deg);"> </i>
                        </li>
                        <li class="item" style="flex: 1;height: 100%; display: flex;  flex-direction: column;">
                            <a href="/cultivate/courseIndex?pageSign=2" style="text-align: center;position: relative;font-size: 15px;">自建课程</a>
                            <i class="layui-icon layui-icon-triangle-d" style="
                        display: none;   justify-content: center; align-items: center;top: -24px; position: relative;
                    color:#ffffff; transform: rotateX(180deg);"> </i>
                        </li>
                        <li class="item" style="flex: 1;height: 100%; display: flex;  flex-direction: column;">
                            <a href="/cultivate/courseIndex?pageSign=3" style="text-align: center;position: relative;font-size: 15px;">院校名师</a>
                            <i class="layui-icon layui-icon-triangle-d" style="
                        display: none;   justify-content: center; align-items: center;top: -24px; position: relative;
                    color:#ffffff; transform: rotateX(180deg);"> </i>
                        </li>
                        <li class="item" style="flex: 1;height: 100%; display: flex;  flex-direction: column;">
                            <a href="/certificate/policyInfo" style="text-align: center;position: relative;font-size: 15px;">新闻动态</a>
                            <i class="layui-icon layui-icon-triangle-d" style="
                        display: none;   justify-content: center; align-items: center;top: -24px; position: relative;
                    color:#ffffff; transform: rotateX(180deg);"> </i>
                        </li>
                    </ul>

                    <div class="myheader-top-dengs" id="log">
                        <a id="login1" href="/cultivate/cultivateLogins?name=0"> 登录 </a>
                        <a id="reg1" style="border-left: 1px solid #FFFFFF; padding-left: 10px;"
                           href="/cultivate/cultivateLogins?name=1"> 注册 </a>
                    </div>

                    <!--                个人登录页面-->
                    <div id="my" style="display: none">
                        <div class="myCenter" style=" top: 10px;position: relative; right: 60px;">
                            <a href="/cultivate/logTransition">
                                <span class="nm" style="font-size: 15px;"> </span>
                            </a>
                            <a href="/cultivate/editMy">
                                <span style="color: #ffffff">资料修改</span>
                            </a>
                        </div>
                        <div class="logout" style="position: relative; top: -10px;  left: 95px;font-size: 15px;">
                            <a href="#" id="logout" style="color: #ffffff;font-size: 15px;">安全退出</a>
                        </div>
                    </div>
                </div>

        </div>
    </th:block>
    <th:blovk th:unless="${mymenu}">
        <div class="myheader" style="height:150px;">
            <div class="myheader-top" style="height:100%">
                <div class=" main-md" style="  height: 100%;display: flex;   padding-right: 60px; justify-content: space-between;">
                <a href="/cultivate/homepage" class="myImg" style="display: flex;">
                </a>

                <div style="width: calc(100% - 200px); display: flex;
                     justify-content: flex-end;     align-items: center;">

                    <!--                个人登录页面-->
                    <div id="my1" style="display: none">
                        <div class="myCenter" style="  right: 50px;top: 10px;position: relative;">
                            <a href="/cultivate/logTransition">
                                <span class="nm"> </span>
                            </a>
                            <a href="/cultivate/editMy">
                                <span style="color: #000000">资料修改</span>
                            </a>
                        </div>
                        <div class="logout" style="position: relative; top: -10px;  left: 111px;">
                            <a href="#" id="logout1">安全退出</a>
                        </div>
                    </div>
                </div>
            </div>
            </div>

        </div>

    </th:blovk>



    <script>
        //修改login
        $.ajax({
            url: '/banner/getLogo',
            type: 'GET',
            success: function (r) {
                if (r.code == 0||r.code == '0') {
                    $(".myheader .myheader-top .myImg").html(`<img alt="图片"  src="${r.data.value}"
                         style="height: 111px;  width: 545px;margin: auto;">`)
                }else{
                    $(".myheader .myheader-top .myImg").html(`<img alt="图片"  src="/img/header1.png"
                         style="height: 111px;  width: 545px;margin: auto;">`)
                }
            }
        })
        //IE中文传参乱码问题
        var newUrl3 = "/cultivate/news?name=行业信息";
        var newUrl4 = "/cultivate/news?name=通知公告";
        newUrl3 = encodeURI(newUrl3);
        newUrl4 = encodeURI(newUrl4);
        if(location.href.indexOf('/certificate/policyInfo')>-1 && location.href.indexOf('?')>0){

            location.href.split('?')[1].split('&').forEach((item) => {
                if(item.split("=")[0]=='name'){
                    $('#myAllsearchInput').val(item.split("=")[1])
                }
            })
        }

        const mysearch = () => {
            var myvalue = $('#myAllsearchInput').val()
            window.location.href = "/certificate/policyInfo?name=" + myvalue;
            // window.open( "/certificate/policyInfo?name=" + myvalue, "_blank")
        }
        $('#myAllsearch').click(() => {
            mysearch()
        })
        $('#myAllsearchInput').keydown((e) => {
            if (e.keyCode === 13) {
                mysearch()
            }
        })

        $(function () {

            //监听变化
            window.addEventListener("storage", (e)=> {
                    var mobile = window.localStorage.getItem("mobile");
                    console.log("=======修改===>>>>>>>")
                    $(".nm").text(mobile?mobile.substring(0,3)+'***'+mobile.substring(mobile.length-3,mobile.length):'');

            });
            $(".hySpan").attr("href", newUrl3);
            $(".tzSpan").attr("href", newUrl4);
            var url = window.location.href;

            if (url.indexOf("cultivateLogins") != -1) {
                $("#log").css("display", "block");
                $("#my").css("display", "none")
                $("#my1").css("display", "none")
            } else {
                var userName = window.localStorage.getItem("userName");
                var mobile = window.localStorage.getItem("mobile");
                var unreadNum = window.localStorage.getItem("unreadNum1");
                if (userName != "" && userName != null) {
                    //改电话号码
                    $(".nm").text(mobile?mobile.substring(0,3)+'***'+mobile.substring(mobile.length-3,mobile.length):'');

                    $("#log").css("display", "none");
                    $("#my").css("display", "block");
                    $("#my1").css("display", "block");
                    if (unreadNum != 0 && unreadNum != null && unreadNum != '') {
                        $(".bubble").css("display", "inline");
                        $(".bubble").text(unreadNum)
                    }
                } else {
                    $("#log").css("display", "block");
                    $("#my").css("display", "none")
                    $("#my1").css("display", "none")
                }
            }
            //公用导航栏的根据url控制选中导航
            var links = $(".item").find("a");
            var linkI = $(".item").find("i");
            var link = $(".item")
            index = 0,//默认第一个菜单项
                // url = location.href.split('?')[0].split('/').pop();//取当前URL最后一个 / 后面的文件名，pop方法是删除最后一个元素并返回最后一个元素
                url = location.href.split('/').pop();//取当前URL最后一个 / 后面的文件名，pop方法是删除最后一个元素并返回最后一个元素
            // console.log("url",url)
            if (url) {//如果有取到, 则进行匹配, 否则默认为首页(即index的值所指向的那个)
                for (var i = 0; i < links.length; i++) {//遍历 menu 的中连接地址
                    if (links[i].href.indexOf(url) !== -1) {  //有
                        index = i;
                        break;
                    }
                }
            }

            if (url.indexOf("forgetPass") > -1) {
                $("#log").css("display", "inline");
            }
            // console.log('indexindex', index, 'url' + url)
            if (url == '' || url == 'homepage' || url.indexOf('courseIndex') > -1 || url == 'teacher' || url == 'studyOnline' ||
                url == 'getRecruit' || url == 'apply' || url == 'query' || url == 'about' || url == 'startUpBus' || url == 'news' || url == 'ruralIndex') {
                link[index].className += ' active';
                // linkI[index].css("display","flex")
                linkI[index].style.display = 'flex';
            }

            if (url.indexOf("policyDetail") > -1 || (url.indexOf("policyInfo") > -1 && url.indexOf("name")<0)) {
                link[4].className += ' active';
                // linkI[index].css("display","flex")
                linkI[4].style.display = 'flex';

            }
            if (url.indexOf("couInfo") > -1) {
                const mypageData = {}
                url.split('?')[1].split('&').forEach((item) => {
                    mypageData[item.split("=")[0]] = item.split("=")[1]
                })
                link[Number(mypageData.pageSign)].className += ' active';
                // linkI[index].css("display","flex")
                linkI[Number(mypageData.pageSign)].style.display = 'flex';

            }


            $("#logout").click(function () {
                localStorage.clear();
                location.href = '/cultivate/homepage';
            });
            $("#logout1").click(function () {
                localStorage.clear();
                location.href = '/cultivate/homepage';
            });
            $("#doSearch").click(function () {
                var word = $("#title").val();
                if (!word) {
                    layer.alert("请输入要搜索的课程名称！");
                    return;
                }
                word = encodeURI(word);
                window.location.href = "/couInfo/courseSearch?name=" + word;
            });
            $("#msgSize").click(function () {
                location.href = '/cultivate/myMessage';
            })
        });

    </script>

</div>
<!--页尾-->
<div class="foots" th:fragment="footer">
    <!--底部公共-->
    <div class="foot" style="background-color: #0069ac;">
        <div class="main-md">
            <style>
                .foot-div {
                    display: flex;
                    flex-direction: row;
                    justify-content: center;
                    align-items: flex-start;
                    padding-top: 20px;
                    border-bottom: 1px solid #0069AC;
                    padding-bottom: 0px;
                }

                .foot-div-div {
                    width: 50%;
                    display: flex;
                    flex-direction: row;
                    justify-content: flex-start;
                    align-items: center;
                    flex-wrap: wrap;

                }

                .foot-div-div-item {
                    width: calc(100% / 5);
                    text-align: left;
                    color: #FFFFFF;
                    margin-bottom: 10px;
                }

                .foot-div-div-item:hover, .foot-div-div-item2:hover {
                    color: #FFFFFF;
                    text-decoration: none;
                }

                .foot-div-div-item:visited, .foot-div-div-item2:visited {
                    color: #FFFFFF;
                    text-decoration: none;
                }

                .foot-div-div-item:active, .foot-div-div-item2:active {
                    color: #FFFFFF;
                    text-decoration: none;
                }

                .foot-div-div-item2 {
                    width: calc((100% - 40px) / 3);
                    text-align: left;
                    color: #FFFFFF;
                }

                .foot-div2 {
                    display: flex;
                    flex-direction: row;
                    align-items: center;
                    position: relative;
                }

                .foot-div2-right {
                    display: flex;
                    margin-left: 10px;
                    padding-left: 20px;
                    flex-direction: column;
                    align-items: flex-start;
                    border-left: 1px solid #fff;
                }

                .mydemo-dropdown-on{
                    display: flex;
                    flex-direction: row;
                    justify-content: flex-start;
                    align-items: center;
                    flex-wrap: wrap;
                    padding: 20px;
                    background-color: #0d8ddb;
                }
                .mydemo-dropdown-on a{
                    width: calc(100% / 3);
                    color: #FFFFFF;
                }
                .mydemo-dropdown-on a:hover{
                    color: #f19012;
                }
            </style>
            <div class="foot-bottom foot-div2" style="padding: 30px 0;margin-left: -5px;margin-right: -70px">
                <img style="width:45px;height:45px" src="/img/shiyedanwei.png">
                <div class="foot-div2-right">
                    <div>
                        <p style="text-align:left;">
                            <a href="https://beian.miit.gov.cn/" style="color: #fff;" target="_blank">青ICP备2021000110号</a>
                            <a class="img02" href="http://www.beian.gov.cn/portal/registerSystemInfo" target="_blank">
                                <img src="http://www.xncy.edu.cn/style/images/bah.png"></a>
                            <a  href="http://www.beian.gov.cn/" target="_blank" style="color: #fff;">青公网安备 63010502000281号</a>
                        </p>

                    </div>
                    <div style="color: #fff"> 版权所有：西宁城市职业技术学院</div>

                </div>
                <div style="color: #fff;font-size: 14px;margin-left: 105px;width: 25%;text-align: left;line-height: 22px">地址：青海省西宁市城北区宁张路295号 <br> 电话：(0971)4716870
                </div>
                <div>
                    <img src="/img/footer/footerleftlogo.png" />
                    <img src="/img/footer/footertextlogo.png" />
                </div>
            </div>
            <script>

                $(function(){
                    layui.use(['dropdown'], function (){
                        var dropdown = layui.dropdown;
                        // 自定义事件
                        dropdown.render({
                            elem: '.demo-dropdown-on1',
                            trigger: 'hover',
                            content: [
                                '<a href="http://192.168.10.183:84/xzbgs" target="_self">办公室（工会）</a>',
                                '<a href="http://www.xncy.edu.cn/null" target="_self">组织人事部</a>',
                                '<a href="http://www.xncy.edu.cn/null" target="_self">统战部（宣传部）</a>',
                                '<a href="http://192.168.10.183:84/jwc" target="_self">教务部</a>',
                                '<a href="http://www.xncy.edu.cn/01010513.html" target="_self">招生就业部</a>',
                                '<a href="http://192.168.10.183:84/xsgzc" target="_self">学生工作部（团委）</a>',
                                '<a href="http://192.168.10.183:84/cwc" target="_self">财务部</a>',
                                '<a href="http://www.xncy.edu.cn/null" target="_self">保卫部</a>',
                                '<a href="http://www.xncy.edu.cn/null" target="_self">科研管理部</a>',
                                '<a href="http://192.168.10.183:84/hqglc" target="_self">后勤管理部</a>',
                            ].join(''),
                            className: 'mydemo-dropdown-on',
                            style:'width: 400px; height: 200px;'
                        });
                        dropdown.render({
                            elem: '.demo-dropdown-on2',
                            trigger: 'hover',
                            content: [
                                '<a href="http://www.xncy.edu.cn/lsfzxy" target="_self">生态工程系</a>',
                                '<a href="http://192.168.10.183:84/jyx" target="_self">教育系</a>',
                                '<a href="http://www.xncy.edu.cn/null" target="_self">公共教学部</a>',
                                '<a href="http://192.168.10.183:84/jdgcx" target="_self">机电工程系</a>',
                                '<a href="http://192.168.10.183:84/lysmx" target="_self">旅游商贸系</a>',
                                '<a href="http://192.168.10.183:84/xxgcx" target="_self">信息工程系</a>',
                                '<a href="http://192.168.10.183:84/cxxy" target="_self">创新学院</a>',
                            ].join(''),
                            className: 'mydemo-dropdown-on',
                            style:'width: 400px; height: 150px;'
                        });
                        dropdown.render({
                            elem: '.demo-dropdown-on3',
                            trigger: 'hover',
                            content: [
                                '<a href="http://www.xncy.edu.cn/null" target="_self">继续教育与培训中心</a>',
                                '<a href="http://www.xncy.edu.cn/null" target="_self">校企合作部</a>',
                                '<a href="http://xncsxy.portal.chaoxing.com" target="_self">图书传媒信息中心</a>',
                                ' <a href="http://www.xncy.edu.cn/null" target="_self">质量监控与评估中心</a>',
                            ].join(''),
                            className: 'mydemo-dropdown-on',
                            style:'width: 400px; height: 100px;'
                        });
                        // console.log("加载完成")
                    });
                })

            </script>
        </div>
    </div>
</div>
